from app.extensions import db

class MarineArea(db.Model):
    __tablename__ = 'marine_areas'
    
    id = db.Column(db.Integer, primary_key=True)
    area_name = db.Column(db.String(100), nullable=False)
    location_lat = db.Column(db.DECIMAL(10, 6))
    location_lng = db.Column(db.DECIMAL(10, 6))
    description = db.Column(db.Text)
    created_at = db.Column(db.DateTime, server_default=db.func.now())
    
    scores = db.relationship('IndustryScore', backref='marine_area', lazy='dynamic')
    indicators = db.relationship('EcologicalIndicator', backref='marine_area', lazy='dynamic') 